package com.heitian.ssm.service.impl;

import com.heitian.ssm.dao.AddressListDao;
import com.heitian.ssm.model.AddressList;
import com.heitian.ssm.service.AddressListService;
import com.heitian.ssm.util.Pager;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by Zhangxq on 2016/7/15.
 */

@Service
@Transactional(rollbackFor = Exception.class)
public class AddressListServiceImpl implements AddressListService {
    
    @Resource
    private AddressListDao addressListDao;

    public List<AddressList> selectBySearch(String search, Pager pager){
        return addressListDao.selectAddressListBySearch(search,pager);
    }
    public List<AddressList> selectAllAddressList(String search){
        return addressListDao.selectAllAddressList(search);
    }
    public List<AddressList> selectRecentAddressList( String search,String place){
        return addressListDao.selectRecentAddressList(search,place);
    }
    public AddressList findModelById(String id){
        return addressListDao.findAddressListById(id);
    }
    public Integer save(AddressList addressList){
        return addressListDao.saveAddressList(addressList);
    }
    public Integer update(AddressList addressList){
        return addressListDao.updateAddressList(addressList);
    }
    public Integer delete(String id){
        return addressListDao.deleteAddressList(id);
    }

    public Integer getCount(String search) {
        return addressListDao.getAddressListCount(search);
    }
}
